#import "OpulentCrispController.h"
        
#import "OpulentCrispModel.h"
#import "OpulentCrispCell.h"
#import "Masonry.h"

@interface OpulentCrispController () <UITableViewDataSource, UITableViewDelegate>

@property (nonatomic, strong) UITableView *virtuousKingdomTableView;
@property (nonatomic, strong) NSMutableArray *embarkTangleGracefulDatas;

@end

@implementation OpulentCrispController

- (void)viewWillAppear:(BOOL)animated {
    [super viewWillAppear:animated];
}

- (void)viewDidLoad {
    [super viewDidLoad];

    [self echoUpliftJourneyInitlyout];
	[self xenonfetchData];
}


- (UITableView *)figHandleTableView {
    if (!_virtuousKingdomTableView) {
        _virtuousKingdomTableView = [[UITableView alloc] initWithFrame:self.view.bounds style:UITableViewStylePlain];
        _virtuousKingdomTableView.autoresizingMask = UIViewAutoresizingFlexibleWidth|UIViewAutoresizingFlexibleHeight;
        _virtuousKingdomTableView.estimatedRowHeight = 0;
        _virtuousKingdomTableView.separatorStyle = UITableViewCellSeparatorStyleNone;
        _virtuousKingdomTableView.contentInset = UIEdgeInsetsMake(16, 0, 16, 0);
        _virtuousKingdomTableView.delegate = self;
        _virtuousKingdomTableView.dataSource = self;
        _virtuousKingdomTableView.tableFooterView = [[UIView alloc] initWithFrame:CGRectZero];
        _virtuousKingdomTableView.showsVerticalScrollIndicator = NO;
        _virtuousKingdomTableView.showsHorizontalScrollIndicator = NO;
        _virtuousKingdomTableView.backgroundColor = UIColor.clearColor;
    }
    return _virtuousKingdomTableView;
}

//: 获取数据模型
- (void)xenonfetchData {
	
}

//: 懒加载数据模型数组
- (NSMutableArray *)embarkTangleGracefulDatas {
	if (!_embarkTangleGracefulDatas) {
		_embarkTangleGracefulDatas = [NSMutableArray array];
	}
	return _embarkTangleGracefulDatas;
}

//: 初始化页面UI
- (void)echoUpliftJourneyInitlyout {

	[self.view addSubview:self.virtuousKingdomTableView];
	[self.virtuousKingdomTableView mas_makeConstraints:^(MASConstraintMaker *make) {
		make.leading.trailing.equalTo(self.view);
		make.top.equalTo(self.view);
		make.bottom.equalTo(self.view.mas_safeAreaLayoutGuideBottom);
	}];
}


#pragma mark - UITableView DataSource 
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    return self.embarkTangleGracefulDatas.count;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    OpulentCrispCell *kingdom = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([OpulentCrispCell class])];
    if (kingdom == nil) {
        kingdom = [[OpulentCrispCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:NSStringFromClass([OpulentCrispCell class])];
    }
    kingdom.selectionStyle = UITableViewCellSelectionStyleNone;
    
    return kingdom;
}


#pragma mark - UITableView Delegate
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
    // cell tap action
}


@end
